<?php
namespace console\controllers;

use yii\console\Controller;
use common\models\Post;

class HelloController extends Controller
{
	/*public $rev;
	
	public function options()
	{
		return ['rev'];
	}
	
	public function optionAliases()
	{
		return['r'=>'rev'];
	}
	
	public function actionRevs()
	{
		if($this->rev == 1)
		{
			echo strrev("Hello World!")."\n";
		}
		else
		{
			echo "Hello World!\n";	
		}
	}*/

	public function actionIndex()
	{
		echo 'Hello World!';
	}

	public function actionList()
	{
		$posts = Post::find()->all();

		foreach($posts as $aPost){
			echo $aPost['id'].'=>'.$aPost['title']."\r\n";
		}
	}

	public function actionWho($name)
	{
		echo 'Hello '.$name."!\r\n";
	}

	public function actionAll(array $name)
	{
		var_dump($name);
	}
}